Green Vocabulary: A-to-Z list

[insert_php] global $wpdb; for($i=0; $i<26; $i++) { $chr = chr(ord('A')+$i); $cnt = $wpdb->get_var(“SELECT count(*) FROM green_voca WHERE `show`=’y’ AND title LIKE ‘$chr%'”); if($cnt>0) { print “$chr “; } else { print “$chr “; } } [/insert_php]

List by categories

[insert_php] for($i=0; $i<26; $i++) { $chr = chr(ord('A')+$i); $items = $wpdb->get_results(“SELECT * FROM green_voca WHERE `show`=’y’ AND title LIKE ‘$chr%’ ORDER BY title”); if(count($items)<=0) continue; print "“; print ‘‘; foreach($items as $item) { print ““; print ““; print ‘‘; } print ‘‘; } [/insert_php]
 $chr [ top ]
 
 $item->title 
 $item->desc